﻿using System;
using System.Collections.Generic;
using App.Interface;
using Domain.Entidades;
using Domain.Interfaces.Servicos;

namespace App
{
    public class VW_noticiasAppService : AppServiceBase<VW_noticias>, IVW_noticiasAppService
    {
        private readonly IVW_noticiasService _noticiasService;

        public VW_noticiasAppService(IVW_noticiasService noticiasservice)
            : base(noticiasservice)
        {
            _noticiasService = noticiasservice;
        }

        public IEnumerable<VW_noticias> busca_noticias(DateTime data1, DateTime data2)
        {
            return _noticiasService.busca_noticias(data1, data2);

        }
        public void Inserir(noticia not)
        {

            try
            {
                _noticiasService.Inserir(not);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
        public void Editar(noticia not)
        {

            try
            {
                _noticiasService.Editar(not);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
        public void deletar(int codigo)
        {

            try
            {
                _noticiasService.deletar(codigo);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
        public noticia carrega_busca(int codigo)
        {

            try
            {
                return _noticiasService.carrega_busca(codigo);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }

        public VW_noticias ver_noticia(int codigo)
        {

            try
            {
                return _noticiasService.ver_noticia(codigo);
            }
            catch (Exception ex)
            {
                
                throw ex;
            }

        }

    }
}
